home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10563 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++
  4. Subject: Re: C/C++ knocks the crap out of Ada
  5. Date: 8 Mar 1996 09:23:22 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4hpqeaINN338@keats.ugrad.cs.ubc.ca>
  8. References: <4h5hgj$vpd@tomquartz.niestu.com> <4h7jskINNnph@anvil.ugrad.cs.ubc.ca> <313EDF38.61C1@lfwc.lockheed.com> <DnyCz1.A1n@research.att.com>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <DnyCz1.A1n@research.att.com>,
  12. Andrew Koenig <ark@research.att.com> wrote:
  13.  >In article <313EDF38.61C1@lfwc.lockheed.com> Ken Garlington <GarlingtonKE@lfwc.lockheed.com> writes:
  14.  >
  15.  >> Kazimir Kylheku wrote:
  16.  >
  17.  >> > This is false. There are compilers which offer range checking. In a situation
  18.  >> > where safety-critical software is designed, such a compiler should be used.
  19.  >
  20.  >> I thought you were arguing the merits of two languages. Does the C _language_
  21.  >> standard define the syntax and sematics of built-in range checking?
  22.  >
  23.  >Yes and no.  It defines what a range error is, then leaves it up to the
  24.  >implementation to check for it or not.  Most, but not all, C implementations
  25.  >don't bother to check, partly because checking is expensive at run time.
  26.  
  27. That's probably not the true reason, since range checking can be turned off,
  28. thus dispensing with the expense.
  29.  
  30. The real reason is that it's a pain in the ass to implement for the folks
  31. writing the compiler. It's just extra complexity at the code generating stage.
  32.  
  33. Since the compiler writers are likely C experts, who are themselves writing the
  34. compiler in C, they will take on the attitude ``why bother: if we needed range
  35. checking, the compiler we are compiling the new compiler with would have it''.
  36.  
  37. :)
  38. -- 
  39.  
  40.